﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace ProjectFootball.MVC.Models.EntityFramework.Entities
{
    public class Team
    {
        #region Constructor
        public Team()
        {
            TeamVersions = new HashSet<TeamVersion>();
            Team1Matches = new HashSet<Match>();
            Team2Matches = new HashSet<Match>();
        }
        #endregion

        #region Columns
        [Key]
        public Guid TeamGuid { get; set; }
        #endregion

        #region Navigation properties
        [ForeignKey("TeamGuid")]
        public virtual ICollection<TeamVersion> TeamVersions { get; set; }

        [InverseProperty("Team1")]
        public virtual ICollection<Match> Team1Matches { get; set; }

        [InverseProperty("Team2")]
        public virtual ICollection<Match> Team2Matches { get; set; }
        #endregion
    }
}